QSVM Application

Objective: Example of the QSVM application



This is a good classification dataset in the sklearn library.



... however, we will not use this dataset directly, we will transform data into an informative subset using PCA.



SVM vs QSVM

We will run SVM and QSV side by side.

SVM



Model is fast and accurate!

QSVM



WARNING: This will take some time!!

We calculate kernel:



Let us put aside the accuracy and explore the time complexity...

Both SVM and QSVM scales more-than-linearly with sample size.

transpile

transpile

The picture is based on the same dataset, bootstrapped. Numbers as of 09/2021 (situation has improved).



We can run QSVM on this smaller sample but. There is no guarantee that if we choose a smaller subset, it will be balanced.



We will use balanced samples (do not forget this!)



Run-time is ok, but the accuracy is very bad (the method can be easily overtaken by the classical SVM).

Question: What we can do?

Remark: The above comparison of two numbers needs to be repeated to draw any conclusion.



Random Forest



Bootstrapping



Bootstrapping



Bootstrapping



Bootstrapping



Bagging



Bagging

$$ \hat{f}_{bag}\left(x\right)=\frac{1}{B}\sum_{b}\hat{f}_{b}\left(x\right)\,. $$

Bagging and Trees



Bagging and Trees

$$ \hat{G}\left(x\right)=\arg\max_{k}\hat{f}\left(x\right) $$ $$ \hat{G}_{bag}\left(x\right)=\arg\max_{k}\hat{f}_{bag}\left(x\right) $$

Bagging and Trees

    * This is usually available for every classifier
    * It also tends to produce bagged classifiers with lower variance (for small B)



Bagging -- To Overcome the Computational Time of the QSVM



Let us run the individual run on large sample